export default [
    {
        url: 'load/tableList',
        type: 'get',
        callback: (data, cb) => {
            let ps = analysis(data.url)
            let tbList = []
            for (let i = 0; i < ps.limit * 1; i++) {
                let obj = {
                    name: `名字-${ps.page}`,
                    age: `28-${ps.page}`,
                    date: `2023-02-02-${ps.page}`,
                    phone: `13578787678-${ps.page}`,
                    cardid: `220122199210180882-${ps.page}`,
                    booleanType: `${ps.page}`,
                    path: `http://www.baidu.com${ps.page}`
                }
                tbList.push(obj)
            }
            return {
                code: 200,
                msg: '',
                data: {
                    list: tbList,
                    total: 100
                }
            }
        }
    }
]

function analysis(url) {
    let urAry = url.split('?')[1].split('&');
    let pmsStr = {}
    for (let i = 0; i < urAry.length; i++) {
        const element = urAry[i];
        let str = element.split('=');
        if (str.length == 1) {
            pmsStr[str[0]] = ''
        } else {
            pmsStr[str[0]] = str[1]
        }
    }
    return pmsStr
}